# Actions for Canon S500
#
# Printer has following cartridges:
# - Black
# - Colour Cyan, Magenta, Yellow
#
# Created 05-05-2005 T. Milius, D. Thielsch
# Changed 10-01-2005 T. Milius              get command with new Canon length
# Changed 03-29-2006 T. Milius              Low Ink message at yellow and
#                                           cyan cartridges swapped
# Changed 03-30-2006 D. Webb, T. Milius     Ink level for low ink message
#                                           at yellow and cyan cartridges swapped
#
GetCartridgeInfo:
hide 0 upwards
eval COL_0 # 1024
eval COL_1 # 1024
eval COL_2 # 1024
eval COL_3 # 1024
send 27,"[","K",12,0,0,30,0,10,"S","S","R","=","D","W","S",";"
get -2
split RESPONSE TEXT_0 # DWS:%[^;]
cgorel 22 TEXT_0 # %0="NO" OR %0="UK"
eval INT_0 # 0
eval TEXT_0 # ""
split RESPONSE INT_0 TEXT_0 # DWS:%x,%[^;]
cgorel 2 INT_0 # %0 <> &1501
show 1 <PrtInfo$Dir>.Resources.Warnings.Canon.S500.LOW_B
eval COL_0 # 50
cgorel 2 INT_0 # %0 <> &1511
show 2 <PrtInfo$Dir>.Resources.Warnings.Canon.S500.LOW_Y
eval COL_3 # 50
cgorel 2 INT_0 # %0 <> &1512
show 3 <PrtInfo$Dir>.Resources.Warnings.Canon.S500.LOW_M
eval COL_2 # 50
cgorel 2 INT_0 # %0 <> &1513
show 4 <PrtInfo$Dir>.Resources.Warnings.Canon.S500.LOW_C
eval COL_1 # 50
cgorel 5 TEXT_0 # (LEN %0)=0
eval RESPONSE TEXT_0 # %0
eval INT_0 # 0
eval TEXT_0 # ""
split RESPONSE INT_0 TEXT_0 # %x,%[^;]
cgorel -14 # 1=1
show 0 <PrtInfo$Dir>.Resources.Cartridges.Canon.S500
End 
# 
CleanHead: 31
hide 0 upwards
send 27,"[","K",2,0,0,31,"B","J","L","S","T","A","R","T",10
send "@","C","l","e","a","n","i","n","g","=","1","K",10
send "B","J","L","E","N","D",10
End
#
CleanHead: 32
hide 0 upwards
send 27,"[","K",2,0,0,31,"B","J","L","S","T","A","R","T",10
send "@","C","l","e","a","n","i","n","g","=","1","C","M","Y",10
send "B","J","L","E","N","D",10
End
# Status is obtained by USB printer class request
GetStatus: USB
eval MESSAGE MANUFACTURER PRINTERTYPE # %0 + " " + %1
End
# Status is obtained by parallel interface
GetStatus: Parallel
eval MESSAGE MANUFACTURER PRINTERTYPE # %0 + " " + %1
End
# Reset is done by USB printer class request
ResetPrinter: USB
End
# Reset is done by Parallel interface
ResetPrinter: Parallel
End
#
PrintTestpattern:
eval INT_0 # 0
cgorel 3 INT_0 # <Territory><>7 OR %0=1
eval DIALOGMESSAGE # "Bitte Papier einlegen!"
ask Gemacht Abbrechen
eval INT_0 # 1
cgorel 3 INT_0 # <Territory><>35 OR %0=1
eval DIALOGMESSAGE # "Bitte Papier einlegen!"
ask Gemacht Abbrechen
eval INT_0 # 1
cgorel 2 INT_0 # %0=1
eval DIALOGMESSAGE # "Please insert paper!"
ask Done Cancel
cgorel 50 DIALOGRESULT # %0=4
send 27,"[","K",2,0,0,31,"B","J","L","S","T","A","R","T",10
send "@","T","e","s","t","P","r","i","n","t","=","N","o","z","z","l","e","C","h","e","c","k",10
send "B","J","L","E","N","D",10
End
#
Init:
action GetStatus:
End
